package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JsonUtil;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
public class Hotel extends BaseDomain{

    public static final Integer STATE_NORMAL = 0;
    public static final Integer STATE_RECOMMEND  = 1;

    //酒店名称
    private String name;

    //酒店描述
    private HotelContent hotelContent;
    //价格
    private BigDecimal price;

    //封面
    private String coverUrl;

    //状态
    private Integer state;

    public String getJson(){
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("name",name);
        map.put("price",price);
        map.put("coverUrl",coverUrl);
        map.put("state",state);
        if (hotelContent != null){
            map.put("content",hotelContent.getContent());
        }
        return JsonUtil.toJsonString(map);
    }
}